<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\Record;

class OriginRecordController extends Controller
{
    public function index(Request $request){

        $where = function ($query) use ($request) {

            if($request->has('origin_id') and $request->origin_id !== '-1') {
                $query->where('origin_id',$request->origin_id);
            }

        };

        $records = Record::where($where)
            ->orderBy('create_time','desc')->paginate(10);
        $status = config('system.status');
        //return $records;
        return view('admin.originrecord.index', compact('records','status'));
    }
}


